{extend name="common/main"/}

{block name="style"}

{/block}

{block name="body"}
<ol class="breadcrumb">
	<i class="icon icon-angle-left"></i>
	<li>
		<a href="{:url('lists')}">创作者管理</a>
	</li>
	<li>
		创作者列表
	</li>
</ol>
<div class="margin-bottom">
	<a class="btn btn-primary margin-right" href="{:url('edit')}" role="button">+ 新增创作者</a>
</div>

<section class="author-list-section">

	<div class="row clearfix margin-bottom">
		<form action="" method="get" class="search-form" role="form">
			<div class="col-sm-3">
				<div class="input-group">
					<div class="input-control search-box has-icon-left has-icon-right search-example" id="searchboxExample">
					<input class="form-control" name="keyword" placeholder="关键字" id="" type="text" value="{$keyword}">
					<label for="inputSearchExample4" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
					</div>
					<span class="input-group-btn">
					<button class="btn btn-primary" type="submit">搜索</button>
					</span>
				</div>
			</div>
		</form>
	</div>
	
	<div class="list-section ">
		<div class="status-nav" data-status="{$status}">
			<div class="status-nav" data-status="{$status}">
				<a class="all btn" href="{:url('lists')}">
					全部
				</a>
				<a class="status1 btn" href="{:url('lists', ['status'=>1])}">
					已启用 
				</a>
				<a class="status0 btn" href="{:url('lists', ['status'=>0])}">
					已禁用 
				</a>
				<a class="status-1 btn" href="{:url('lists', ['status'=>-1])}">
					未审核
				</a>
				<a class="status-2 btn" href="{:url('lists', ['status'=>-2])}">
					审核未通过 
				</a>
				<a class="status-3 btn" href="{:url('lists', ['status'=>-3])}">
					已删除 
				</a>
			</div>
		</div>
		<script>
			$(function(){
				var status = $('.status-nav').data('status');
				// console.log(status);
				$('.status-nav .btn').removeClass('btn-info');
				if(status == 'all'){
					$('.status-nav .all').addClass('btn-info');
				}
				if(status == 1){
					$('.status-nav .status1').addClass('btn-info');
				}
				if(status == 0){
					$('.status-nav .status0').addClass('btn-info');
				}
				if(status == -1){
					$('.status-nav .status-1').addClass('btn-info');
				}
				if(status == -2){
					$('.status-nav .status-2').addClass('btn-info');
				}
			})
		</script>
        {if empty($lists)}
        {include file="common/_empty"/}
        {else /}
		<div class="items-section clearfix">
            {volist name="$lists.data" id="v"}
            <div class="item">
                <div class="card ">
                    <div class="cover">
                        <img src="{$v['cover_200']}">
                    </div>
                    <div class="info">
                        <h3 class="title text-ellipsis">{$v['name']}</h3>
                        <div class="description text-ellipsis-2">{$v['description']}</div>
                    </div>
                    <div class="action">
                        {if $v['status'] == 1}
						<a href="{:url('status', ['ids'=>$v['id'],'status'=> 0])}" class="btn btn-sm btn-warning ajax-get">禁用</a>
                        {/if}
						{if $v['status'] == 0}
						<a href="{:url('status', ['ids'=>$v['id'],'status'=> 1])}" class="btn btn-sm btn-info ajax-get">启用</a>
                        {/if}
                        {if $v['status'] == -1}
                            <button class="btn btn-sm btn-warning" data-remote="{:url('verify', ['id' => $v['id']])}" data-toggle="modal">未审核</button>
                        {/if}
                        {if $v['status'] == -2}
                            <button class="btn btn-sm btn-danger" disabled>审核未通过</button>
                        {/if}
                        
                        <a href="{:url('edit', ['id' => $v['id']])}" class="btn btn-sm btn-primary">编辑</a>
                        
                        <a href="{:url('status', ['ids' => $v['id'],'status'=> -3])}" data-confirm="确认执行删除操作？" class="btn btn-sm btn-danger ajax-get">
                            <i class="fa fa-times"></i> 删除
                        </a>
                        
                    </div>
                </div>
            </div>
			{/volist}
		</div>
	</div>

    <div class="page-section">
        {:htmlspecialchars_decode($pager)}
    </div>
    {/if}
</section>
{/block}

{block name="script"}

{/block}